home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
TIFF_WIN
/
ABOUT_BO.C
next >
Wrap
C/C++ Source or Header
|
1990-01-24
|
1KB
|
48 lines
#include "my color.h"
pascal Boolean MyModalFilter(DialogPtr,EventRecord *,short *);
DoAboutBox()
{
short itemHit;
WindowPtr myWindow;
myWindow = GetNewDialog(ABOUT_BOX, nil, (WindowPtr) -1);
do
{
ModalDialog (MyModalFilter, &itemHit);
}
while (itemHit != 1);
DisposDialog (myWindow);
} /*DoAboutBox*/
/* function MyFilter (theDialog: DialogPtr; var theEvent: EventRecord;*/
/* var itemHit: Integer): Boolean; */
pascal Boolean MyModalFilter(theDialog,theEvent,itemHit)
DialogPtr theDialog;
EventRecord *theEvent;
short *itemHit;
{
short theType;
Handle theItem;
Rect theBox;
long finalTicks;
if (((theEvent->message & charCodeMask) == 13) || /*carriage return*/
((theEvent->message & charCodeMask) == 3)) /*enter*/
{
GetDItem (theDialog, 1, &theType, &theItem, &theBox);
HiliteControl((ControlHandle)theItem, 1);
Delay(8, &finalTicks);
HiliteControl((ControlHandle)theItem, 0);
*itemHit = 1;
return(true);
} /*if BitAnd...*/
else
return(false);
} /* MyModalFilter */